package week_6.practice;
//计算课本中背部疼痛诊断器中决策树的叶子节点个数和决策树的深度
import week_6.practice.DecisionTree;

import java.io.*;

/**
 * BackPainAnaylyzer demonstrates the use of a binary decision tree to 
 * diagnose back pain.
 */
public class BackPainAnalyzer
{
    /**
     *  Asks questions of the user to diagnose a medical problem.
     */
    public static void main (String[] args) throws FileNotFoundException
    {
        System.out.println ("So, you're having back pain.");

        DecisionTree expert = new DecisionTree("D:\\20172328lxy\\20172328lxy\\src\\week_6\\practice\\input.txt");
        expert.evaluate();

        System.out.println("决策树的深度为："+ expert.getTree().getHeight());
        System.out.println("决策树的叶子数为： " + expert.getTree().CountLeaf(expert.getTree().getRoot()));
        System.out.println("递归层序方法，遍历并依次输出每个节点内容:");
        expert.getTree().LevelPrint1();
        System.out.println("---------------------------------------------");
        System.out.println("非递归层序方法，遍历并依次输出每个节点内容:");
        expert.getTree().LevelPrint2();
    }
}
